package course04

object SimpleObjectApp {
  def main(args: Array[String]): Unit = {

//    var person = new People("BQ",30)
//    var person = new People("BQ",30,"M")
  }
}

//主构造器
class People(val name:String , age:Int){

  println("进入了主构造方法....")

  val school = "邹城市实验中学"
  var gender : String = _

  //附属构造器
  def this(name:String,age:Int,gender:String){
    this(name,age) //附属构造器第一行一定要调用主构造器或者其他附属构造器
    this.gender = gender
  }

  println("离开了主构造方法....")
}